<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('绑定流程')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-instance-edit" th:object="${sysFormInstance}">
            <input name="id" th:field="*{id}" type="hidden">

            <div class="form-group">
                <label class="col-sm-3 control-label">流程：</label>
                <div class="col-sm-8">
                    <select name="processKey" th:with="type=${@form.getFlow('')}" class="form-control m-b" required>
                        <option th:each="dict : ${type}" th:text="${dict.name}" th:value="${dict.key}" th:field="*{processKey}" ></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label "></label>
                <div class="col-sm-8">
                    <span class="help-block m-b-none text-warning"><i class="fa fa-info-circle"></i> 请注意：选定流程后，后续表单审批走向都将按照所选流程</span>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = "/from/instance";
        $("#form-instance-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/bindProcess", $('#form-instance-edit').serialize());
            }
        }
    </script>
</body>
</html>